1 /*
2  * This file is part of gtkD.
3  *
4  * gtkD is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU Lesser General Public License
6  * as published by the Free Software Foundation; either version 3
7  * of the License, or (at your option) any later version, with
8  * some exceptions, please read the COPYING file.
9  *
10  * gtkD is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public License
16  * along with gtkD; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA
18  */
19 
20 // generated automatically - do not change
21 // find conversion definition on APILookup.txt
22 // implement new conversion functionalities on the wrap.utils pakage
23 
24 
25 module adw.PreferencesPage;
26 
27 private import adw.PreferencesGroup;
28 private import adw.c.functions;
29 public  import adw.c.types;
30 private import glib.ConstructionException;
31 private import glib.Str;
32 private import glib.c.functions;
33 private import gobject.ObjectG;
34 private import gtk.AccessibleIF;
35 private import gtk.AccessibleT;
36 private import gtk.BuildableIF;
37 private import gtk.BuildableT;
38 private import gtk.ConstraintTargetIF;
39 private import gtk.ConstraintTargetT;
40 private import gtk.Widget;
41 
42 
43 /**
44  * A page from [class@PreferencesWindow].
45  * 
46  * <picture>
47  * <source srcset="preferences-page-dark.png" media="(prefers-color-scheme: dark)">
48  * <img src="preferences-page.png" alt="preferences-page">
49  * </picture>
50  * 
51  * The `AdwPreferencesPage` widget gathers preferences groups into a single page
52  * of a preferences window.
53  * 
54  * ## CSS nodes
55  * 
56  * `AdwPreferencesPage` has a single CSS node with name `preferencespage`.
57  * 
58  * ## Accessibility
59  * 
60  * `AdwPreferencesPage` uses the `GTK_ACCESSIBLE_ROLE_GROUP` role.
61  *
62  * Since: 1.0
63  */
64 public class PreferencesPage : Widget
65 {
66 	/** the main Gtk struct */
67 	protected AdwPreferencesPage* adwPreferencesPage;
68 
69 	/** Get the main Gtk struct */
70 	public AdwPreferencesPage* getPreferencesPageStruct(bool transferOwnership = false)
71 	{
72 		if (transferOwnership)
73 			ownedRef = false;
74 		return adwPreferencesPage;
75 	}
76 
77 	/** the main Gtk struct as a void* */
78 	protected override void* getStruct()
79 	{
80 		return cast(void*)adwPreferencesPage;
81 	}
82 
83 	/**
84 	 * Sets our main struct and passes it to the parent class.
85 	 */
86 	public this (AdwPreferencesPage* adwPreferencesPage, bool ownedRef = false)
87 	{
88 		this.adwPreferencesPage = adwPreferencesPage;
89 		super(cast(GtkWidget*)adwPreferencesPage, ownedRef);
90 	}
91 
92 
93 	/** */
94 	public static GType getType()
95 	{
96 		return adw_preferences_page_get_type();
97 	}
98 
99 	/**
100 	 * Creates a new `AdwPreferencesPage`.
101 	 *
102 	 * Returns: the newly created `AdwPreferencesPage`
103 	 *
104 	 * Since: 1.0
105 	 *
106 	 * Throws: ConstructionException GTK+ fails to create the object.
107 	 */
108 	public this()
109 	{
110 		auto __p = adw_preferences_page_new();
111 
112 		if(__p is null)
113 		{
114 			throw new ConstructionException("null returned by new");
115 		}
116 
117 		this(cast(AdwPreferencesPage*) __p);
118 	}
119 
120 	/**
121 	 * Adds a preferences group to @self.
122 	 *
123 	 * Params:
124 	 *     group = the group to add
125 	 *
126 	 * Since: 1.0
127 	 */
128 	public void add(PreferencesGroup group)
129 	{
130 		adw_preferences_page_add(adwPreferencesPage, (group is null) ? null : group.getPreferencesGroupStruct());
131 	}
132 
133 	/**
134 	 * Gets the icon name for @self.
135 	 *
136 	 * Returns: the icon name for @self
137 	 *
138 	 * Since: 1.0
139 	 */
140 	public string getIconName()
141 	{
142 		return Str.toString(adw_preferences_page_get_icon_name(adwPreferencesPage));
143 	}
144 
145 	/**
146 	 * Gets the name of @self.
147 	 *
148 	 * Returns: the name of @self
149 	 *
150 	 * Since: 1.0
151 	 */
152 	public override string getName()
153 	{
154 		return Str.toString(adw_preferences_page_get_name(adwPreferencesPage));
155 	}
156 
157 	/**
158 	 * Gets the title of @self.
159 	 *
160 	 * Returns: the title of @self.
161 	 *
162 	 * Since: 1.0
163 	 */
164 	public string getTitle()
165 	{
166 		return Str.toString(adw_preferences_page_get_title(adwPreferencesPage));
167 	}
168 
169 	/**
170 	 * Gets whether an embedded underline in the title indicates a mnemonic.
171 	 *
172 	 * Returns: whether an embedded underline in the title indicates a mnemonic
173 	 *
174 	 * Since: 1.0
175 	 */
176 	public bool getUseUnderline()
177 	{
178 		return adw_preferences_page_get_use_underline(adwPreferencesPage) != 0;
179 	}
180 
181 	/**
182 	 * Removes a group from @self.
183 	 *
184 	 * Params:
185 	 *     group = the group to remove
186 	 *
187 	 * Since: 1.0
188 	 */
189 	public void remove(PreferencesGroup group)
190 	{
191 		adw_preferences_page_remove(adwPreferencesPage, (group is null) ? null : group.getPreferencesGroupStruct());
192 	}
193 
194 	/**
195 	 * Sets the icon name for @self.
196 	 *
197 	 * Params:
198 	 *     iconName = the icon name
199 	 *
200 	 * Since: 1.0
201 	 */
202 	public void setIconName(string iconName)
203 	{
204 		adw_preferences_page_set_icon_name(adwPreferencesPage, Str.toStringz(iconName));
205 	}
206 
207 	/**
208 	 * Sets the name of @self.
209 	 *
210 	 * Params:
211 	 *     name = the name
212 	 *
213 	 * Since: 1.0
214 	 */
215 	public override void setName(string name)
216 	{
217 		adw_preferences_page_set_name(adwPreferencesPage, Str.toStringz(name));
218 	}
219 
220 	/**
221 	 * Sets the title of @self.
222 	 *
223 	 * Params:
224 	 *     title = the title
225 	 *
226 	 * Since: 1.0
227 	 */
228 	public void setTitle(string title)
229 	{
230 		adw_preferences_page_set_title(adwPreferencesPage, Str.toStringz(title));
231 	}
232 
233 	/**
234 	 * Sets whether an embedded underline in the title indicates a mnemonic.
235 	 *
236 	 * Params:
237 	 *     useUnderline = `TRUE` if underlines in the text indicate mnemonics
238 	 *
239 	 * Since: 1.0
240 	 */
241 	public void setUseUnderline(bool useUnderline)
242 	{
243 		adw_preferences_page_set_use_underline(adwPreferencesPage, useUnderline);
244 	}
245 }